3.77 \(\int x (d+e x) (a+b \log (c x^n))^2 \, dx\)

Optimal. Leaf size=109 \[ \frac{1}{2} d x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac{1}{2} b d n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{3} e x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac{2}{9} b e n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{4} b^2 d n^2 x^2+\frac{2}{27} b^2 e n^2 x^3 \]

[Out]

(b^2*d*n^2*x^2)/4 + (2*b^2*e*n^2*x^3)/27 - (b*d*n*x^2*(a + b*Log[c*x^n]))/2 - (2*b*e*n*x^3*(a + b*Log[c*x^n]))
/9 + (d*x^2*(a + b*Log[c*x^n])^2)/2 + (e*x^3*(a + b*Log[c*x^n])^2)/3

________________________________________________________________________________________

Rubi [A]  time = 0.11196, antiderivative size = 109, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {2353, 2305, 2304} \[ \frac{1}{2} d x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac{1}{2} b d n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{3} e x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac{2}{9} b e n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{4} b^2 d n^2 x^2+\frac{2}{27} b^2 e n^2 x^3 \]

Antiderivative was successfully verified.

[In]

Int[x*(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(b^2*d*n^2*x^2)/4 + (2*b^2*e*n^2*x^3)/27 - (b*d*n*x^2*(a + b*Log[c*x^n]))/2 - (2*b*e*n*x^3*(a + b*Log[c*x^n]))
/9 + (d*x^2*(a + b*Log[c*x^n])^2)/2 + (e*x^3*(a + b*Log[c*x^n])^2)/3

Rule 2353

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

\begin{align*} \int x (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\int \left (d x \left (a+b \log \left (c x^n\right )\right )^2+e x^2 \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=\frac{1}{2} d x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac{1}{3} e x^3 \left (a+b \log \left (c x^n\right )\right )^2-(b d n) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx-\frac{1}{3} (2 b e n) \int x^2 \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=\frac{1}{4} b^2 d n^2 x^2+\frac{2}{27} b^2 e n^2 x^3-\frac{1}{2} b d n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac{2}{9} b e n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac{1}{2} d x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac{1}{3} e x^3 \left (a+b \log \left (c x^n\right )\right )^2\\ \end{align*}

Mathematica [A]  time = 0.0524036, size = 82, normalized size = 0.75 \[ \frac{1}{108} x^2 \left (54 d \left (a+b \log \left (c x^n\right )\right )^2+27 b d n \left (-2 a-2 b \log \left (c x^n\right )+b n\right )+36 e x \left (a+b \log \left (c x^n\right )\right )^2+8 b e n x \left (-3 a-3 b \log \left (c x^n\right )+b n\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(x^2*(8*b*e*n*x*(-3*a + b*n - 3*b*Log[c*x^n]) + 27*b*d*n*(-2*a + b*n - 2*b*Log[c*x^n]) + 54*d*(a + b*Log[c*x^n
])^2 + 36*e*x*(a + b*Log[c*x^n])^2))/108

________________________________________________________________________________________

Maple [C]  time = 0.264, size = 1621, normalized size = 14.9 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(e*x+d)*(a+b*ln(c*x^n))^2,x)

[Out]

1/3*I*ln(c)*Pi*b^2*e*x^3*csgn(I*c*x^n)^2*csgn(I*c)-1/9*I*Pi*b^2*e*n*x^3*csgn(I*x^n)*csgn(I*c*x^n)^2+1/3*I*Pi*a
*b*e*x^3*csgn(I*c*x^n)^2*csgn(I*c)+1/2*I*ln(c)*Pi*b^2*d*x^2*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I*Pi*a*b*d*x^2*csg
n(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-1/3*I*ln(c)*Pi*b^2*e*x^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-1/3*I*Pi*a*b*e*x
^3*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+1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*c*x^n)^6+1/6*b^2*x^2*(2*e*x+3*d)*ln(x^n)^2-1/12*Pi^2*b^2*e*x^3*csgn(I*c*x^n)^6-1/
3*I*ln(c)*Pi*b^2*e*x^3*csgn(I*c*x^n)^3+1/4*I*Pi*b^2*d*n*x^2*csgn(I*c*x^n)^3-1/2*I*Pi*a*b*d*x^2*csgn(I*c*x^n)^3
+1/6*Pi^2*b^2*e*x^3*csgn(I*x^n)^2*csgn(I*c*x^n)^3*csgn(I*c)-1/12*Pi^2*b^2*e*x^3*csgn(I*x^n)^2*csgn(I*c*x^n)^2*
csgn(I*c)^2

________________________________________________________________________________________

Maxima [A]  time = 1.12567, size = 203, normalized size = 1.86 \begin{align*} \frac{1}{3} \, b^{2} e x^{3} \log \left (c x^{n}\right )^{2} - \frac{2}{9} \, a b e n x^{3} + \frac{2}{3} \, a b e x^{3} \log \left (c x^{n}\right ) + \frac{1}{2} \, b^{2} d x^{2} \log \left (c x^{n}\right )^{2} - \frac{1}{2} \, a b d n x^{2} + \frac{1}{3} \, a^{2} e x^{3} + a b d x^{2} \log \left (c x^{n}\right ) + \frac{1}{2} \, a^{2} d x^{2} + \frac{1}{4} \,{\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} d + \frac{2}{27} \,{\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} e \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/3*b^2*e*x^3*log(c*x^n)^2 - 2/9*a*b*e*n*x^3 + 2/3*a*b*e*x^3*log(c*x^n) + 1/2*b^2*d*x^2*log(c*x^n)^2 - 1/2*a*b
*d*n*x^2 + 1/3*a^2*e*x^3 + a*b*d*x^2*log(c*x^n) + 1/2*a^2*d*x^2 + 1/4*(n^2*x^2 - 2*n*x^2*log(c*x^n))*b^2*d + 2
/27*(n^2*x^3 - 3*n*x^3*log(c*x^n))*b^2*e

________________________________________________________________________________________

Fricas [B]  time = 1.01106, size = 506, normalized size = 4.64 \begin{align*} \frac{1}{27} \,{\left (2 \, b^{2} e n^{2} - 6 \, a b e n + 9 \, a^{2} e\right )} x^{3} + \frac{1}{4} \,{\left (b^{2} d n^{2} - 2 \, a b d n + 2 \, a^{2} d\right )} x^{2} + \frac{1}{6} \,{\left (2 \, b^{2} e x^{3} + 3 \, b^{2} d x^{2}\right )} \log \left (c\right )^{2} + \frac{1}{6} \,{\left (2 \, b^{2} e n^{2} x^{3} + 3 \, b^{2} d n^{2} x^{2}\right )} \log \left (x\right )^{2} - \frac{1}{18} \,{\left (4 \,{\left (b^{2} e n - 3 \, a b e\right )} x^{3} + 9 \,{\left (b^{2} d n - 2 \, a b d\right )} x^{2}\right )} \log \left (c\right ) - \frac{1}{18} \,{\left (4 \,{\left (b^{2} e n^{2} - 3 \, a b e n\right )} x^{3} + 9 \,{\left (b^{2} d n^{2} - 2 \, a b d n\right )} x^{2} - 6 \,{\left (2 \, b^{2} e n x^{3} + 3 \, b^{2} d n x^{2}\right )} \log \left (c\right )\right )} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/27*(2*b^2*e*n^2 - 6*a*b*e*n + 9*a^2*e)*x^3 + 1/4*(b^2*d*n^2 - 2*a*b*d*n + 2*a^2*d)*x^2 + 1/6*(2*b^2*e*x^3 +
3*b^2*d*x^2)*log(c)^2 + 1/6*(2*b^2*e*n^2*x^3 + 3*b^2*d*n^2*x^2)*log(x)^2 - 1/18*(4*(b^2*e*n - 3*a*b*e)*x^3 + 9
*(b^2*d*n - 2*a*b*d)*x^2)*log(c) - 1/18*(4*(b^2*e*n^2 - 3*a*b*e*n)*x^3 + 9*(b^2*d*n^2 - 2*a*b*d*n)*x^2 - 6*(2*
b^2*e*n*x^3 + 3*b^2*d*n*x^2)*log(c))*log(x)

________________________________________________________________________________________

Sympy [B]  time = 2.49389, size = 304, normalized size = 2.79 \begin{align*} \frac{a^{2} d x^{2}}{2} + \frac{a^{2} e x^{3}}{3} + a b d n x^{2} \log{\left (x \right )} - \frac{a b d n x^{2}}{2} + a b d x^{2} \log{\left (c \right )} + \frac{2 a b e n x^{3} \log{\left (x \right )}}{3} - \frac{2 a b e n x^{3}}{9} + \frac{2 a b e x^{3} \log{\left (c \right )}}{3} + \frac{b^{2} d n^{2} x^{2} \log{\left (x \right )}^{2}}{2} - \frac{b^{2} d n^{2} x^{2} \log{\left (x \right )}}{2} + \frac{b^{2} d n^{2} x^{2}}{4} + b^{2} d n x^{2} \log{\left (c \right )} \log{\left (x \right )} - \frac{b^{2} d n x^{2} \log{\left (c \right )}}{2} + \frac{b^{2} d x^{2} \log{\left (c \right )}^{2}}{2} + \frac{b^{2} e n^{2} x^{3} \log{\left (x \right )}^{2}}{3} - \frac{2 b^{2} e n^{2} x^{3} \log{\left (x \right )}}{9} + \frac{2 b^{2} e n^{2} x^{3}}{27} + \frac{2 b^{2} e n x^{3} \log{\left (c \right )} \log{\left (x \right )}}{3} - \frac{2 b^{2} e n x^{3} \log{\left (c \right )}}{9} + \frac{b^{2} e x^{3} \log{\left (c \right )}^{2}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(e*x+d)*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*d*x**2/2 + a**2*e*x**3/3 + a*b*d*n*x**2*log(x) - a*b*d*n*x**2/2 + a*b*d*x**2*log(c) + 2*a*b*e*n*x**3*log(
x)/3 - 2*a*b*e*n*x**3/9 + 2*a*b*e*x**3*log(c)/3 + b**2*d*n**2*x**2*log(x)**2/2 - b**2*d*n**2*x**2*log(x)/2 + b
**2*d*n**2*x**2/4 + b**2*d*n*x**2*log(c)*log(x) - b**2*d*n*x**2*log(c)/2 + b**2*d*x**2*log(c)**2/2 + b**2*e*n*
*2*x**3*log(x)**2/3 - 2*b**2*e*n**2*x**3*log(x)/9 + 2*b**2*e*n**2*x**3/27 + 2*b**2*e*n*x**3*log(c)*log(x)/3 -
2*b**2*e*n*x**3*log(c)/9 + b**2*e*x**3*log(c)**2/3

________________________________________________________________________________________

Giac [B]  time = 1.28571, size = 335, normalized size = 3.07 \begin{align*} \frac{1}{3} \, b^{2} n^{2} x^{3} e \log \left (x\right )^{2} - \frac{2}{9} \, b^{2} n^{2} x^{3} e \log \left (x\right ) + \frac{2}{3} \, b^{2} n x^{3} e \log \left (c\right ) \log \left (x\right ) + \frac{1}{2} \, b^{2} d n^{2} x^{2} \log \left (x\right )^{2} + \frac{2}{27} \, b^{2} n^{2} x^{3} e - \frac{2}{9} \, b^{2} n x^{3} e \log \left (c\right ) + \frac{1}{3} \, b^{2} x^{3} e \log \left (c\right )^{2} - \frac{1}{2} \, b^{2} d n^{2} x^{2} \log \left (x\right ) + \frac{2}{3} \, a b n x^{3} e \log \left (x\right ) + b^{2} d n x^{2} \log \left (c\right ) \log \left (x\right ) + \frac{1}{4} \, b^{2} d n^{2} x^{2} - \frac{2}{9} \, a b n x^{3} e - \frac{1}{2} \, b^{2} d n x^{2} \log \left (c\right ) + \frac{2}{3} \, a b x^{3} e \log \left (c\right ) + \frac{1}{2} \, b^{2} d x^{2} \log \left (c\right )^{2} + a b d n x^{2} \log \left (x\right ) - \frac{1}{2} \, a b d n x^{2} + \frac{1}{3} \, a^{2} x^{3} e + a b d x^{2} \log \left (c\right ) + \frac{1}{2} \, a^{2} d x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/3*b^2*n^2*x^3*e*log(x)^2 - 2/9*b^2*n^2*x^3*e*log(x) + 2/3*b^2*n*x^3*e*log(c)*log(x) + 1/2*b^2*d*n^2*x^2*log(
x)^2 + 2/27*b^2*n^2*x^3*e - 2/9*b^2*n*x^3*e*log(c) + 1/3*b^2*x^3*e*log(c)^2 - 1/2*b^2*d*n^2*x^2*log(x) + 2/3*a
*b*n*x^3*e*log(x) + b^2*d*n*x^2*log(c)*log(x) + 1/4*b^2*d*n^2*x^2 - 2/9*a*b*n*x^3*e - 1/2*b^2*d*n*x^2*log(c) +
 2/3*a*b*x^3*e*log(c) + 1/2*b^2*d*x^2*log(c)^2 + a*b*d*n*x^2*log(x) - 1/2*a*b*d*n*x^2 + 1/3*a^2*x^3*e + a*b*d*
x^2*log(c) + 1/2*a^2*d*x^2